/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


//todo enum
export const enum YogaLayoutType {
  LAYOUT = 0,
  MEASURE = 1,
  CACHED_LAYOUT = 2,
  CACHED_MEASURE = 3,
}

export function getYogaLayoutTypeFromNumber(value: number): number | never {
  switch (value) {
    case 0: return YogaLayoutType.LAYOUT;
    case 1: return YogaLayoutType.MEASURE;
    case 2: return YogaLayoutType.CACHED_LAYOUT;
    case 3: return YogaLayoutType.CACHED_MEASURE;
    default: throw new Error("Unknown enum value: " + value);
  }
}

//
//export class YogaLayoutType {
//
//  public static readonly LAYOUT = 0
//  public static readonly MEASURE = 1
//  public static readonly CACHED_LAYOUT = 0
//  public static readonly CACHED_MEASURE = 1
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaLayoutType.LAYOUT;
//      case 1: return YogaLayoutType.MEASURE;
//      case 2: return YogaLayoutType.CACHED_LAYOUT;
//      case 3: return YogaLayoutType.CACHED_MEASURE;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
